const http = require('../../utils/http')

Page({
      data: {
            activityList: []

      },
      onLoad: function (options) {
            this.getActivityList();
      },
      // ，0:待支付，1：已支付
      getActivityList() {
            http.request({
                  url: '/activityRecord/list',
                  method: 'GET',
                  callBack: (res) => {
                        if (res.length > 0) {
                              res.forEach((item)=>{
                                    item.fee=parseFloat(item.fee/100).toFixed(2)
                                    if(item.status==0){
                                          item.txt='待支付'
                                    }else{
                                          item.txt='已支付'
                                    }
                              })
                              this.setData({
                                    activityList: res
                              })
                        }
                  }
            })
      },
      toJoinActivity(e) {
            let item = e.currentTarget.dataset.current
            console.log(item,'item----')
            wx.setStorage({
                  key: 'activity',
                  data: item,
                  success: (res) => {
                        wx.navigateTo({
                              url: '/pages/createActivityOrder/index'
                        })
                  }
            })

      }
});